<!-- 频道 -->
<template>
  <van-tabs v-model:active="active">
  <van-tab v-for=" item in list" :key="item.id" :title="item.text"></van-tab>
  </van-tabs>
  </template>
  <script setup lang="ts">
  import axios from 'axios';
import { ref } from 'vue';
  // 定义数据接口
  interface INavItem{
    id:string,
    text:string
  }
  const active = ref(0)
  const list = ref<INavItem[]>([])
  axios({
    url:'/navList',
    method:'get'
  }).then(res=>{
    // console.log('获取频道数据',res.data);
    list.value = res.data.result
  })
  </script>